from sys import stdin, stderr

for ord in stdin:
	stats = ord.split()
	cards = stats.pop(0)
	players = 6
	# 0 = many, 3 = some, 6 = few
	start = 0
	end = 4
	
	for i in range(6,9):
		stat = (float)(stats[i])
		players += 1
		if(stat > 0.11 and stat <= 0.14):
			print (cards, players)
		
	
	#for stat in stats:
	#	players += 1
	#	if((float)(stat) > 0.25):
	#		print (cards, players)
			